<template>
	<!-- 鸡汤文字内容 -->
	<text class="soupContent" :style="{'-webkit-line-clamp': maxLine}"> <!-- 行内样式 直接覆盖对应的属性 -->
		鸡汤内容1,\n
		鸡汤内容2,\n
		鸡汤内容3\n
		鸡汤内容1,\n
		鸡汤内容1,\n
		鸡汤内容2,\n
		鸡汤内容3\n
		鸡汤内容1,\n
	</text>
	<view class="author">
		<view class="line"></view>

		<view class="outer">
			<view class="userinfo">
				<view class="avatar">
					<image src="../../static/images/logo.png" mode="aspectFill"></image>
				</view>
				<view class="name">zhan san</view>
				<view class="from">摘自好了</view>
			</view>

			<view class="number" v-if="isShowReadNum">
				共 1000 人看过&nbsp&nbsp&nbsp&nbsp
			</view>
		</view>
	</view>
</template>

<script setup>
	defineProps({
		// 默认显示3行，超过部分省略号显示
		maxLine: {
			type: [Number, String],
			default: 'none'
		},
		isShowReadNum: {
			type: Boolean,
			default: false
		}

	})
</script>

<style scoped lang="scss">
	.soupContent {
		font-size: 50rpx;
		width: 100%;
		font-weight: lighter;
		letter-spacing: 0.05em;
		line-height: 1.8em;
		margin-top: 10rpx;
		margin-bottom: 60rpx;
		@include maxline()
	}

	.author {
		display: flex;
		flex-direction: column;

		.line {
			width: 70rpx;
			height: 5rpx;
			background: green;
			margin-bottom: 30rpx;
		}

		.outer {
			display: flex;
			justify-content: space-between;
			align-items: center;

			.number {
				font-size: 26rpx;
				color: #999;
			}

			.userinfo {
				display: flex;
				align-items: center;
				font-size: 26rpx;
				color: #888;


				.avatar {
					width: 40rpx;
					height: 40rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}

				.name {
					padding-left: 12rpx;

				}

				.from {
					padding-left: 12rpx;
				}
			}


		}
	}
</style>